#version 450 core
#extension GL_ARB_explicit_uniform_location : require

layout(location = 0) in vec3 inPos;
layout(location = 1) in vec3 inNormal;
layout(location = 0) out vec3 normal;
layout(location = 1) out vec3 fragPos;

struct World {
    vec3 cameraPos;
    mat4 matVP;
};
layout(binding = 0, std140) uniform WorldBlock {
    World world;
};

#define NUM_MAX_LIGHTS 8
struct Light {
    vec3 ambient;
    vec3 diffuse;
    vec3 specular;
    vec3 position;
};
layout(binding = 1, std140) uniform LightBlock {
    Light light[NUM_MAX_LIGHTS];
};

struct Transform {
    mat4 modelMatrix;
    mat4 mvpMatrix;
    mat4 normalMatrix;
};
layout(location = 0) uniform Transform transform;

void main() {
    gl_Position = transform.mvpMatrix * vec4(inPos, 1.0f);
    normal = inNormal; // vec3(transform.normalMatrix * vec4(inNormal, 1.0f));
    fragPos = inPos; // vec3(transform.modelMatrix * vec4(inPos, 1.0f))
}
